<?php
// +----------------------------------------------------------------------
// | Description: 仪表盘
// +----------------------------------------------------------------------
// | Author: devenc
// +----------------------------------------------------------------------

namespace app\admin\model;

use app\admin\model\Common;

class Dashboard extends Common 
{

    /**
     * 为了数据库的整洁，同时又不影响Model和Controller的名称
     * 我们约定每个模块的数据表都加上相同的前缀，比如微信模块用weixin作为数据表前缀
     */
	protected $name = 'admin_dashboard';
    protected $createTime = 'create_time';
    protected $updateTime = 'update_time';
	protected $autoWriteTimestamp = true;
	protected $insert = [
		'status' => 1, 
	];   

	/**
	 * [getDataList 获取列表]
	 * @devenc
	 * @DateTime  2017-08-17
	 * @return    [array]                         
	 */
	public function getDataList($keywords)
	{
		$map['user_id'] = $GLOBALS['userInfo']['id'];
		if ($param['keywords']) {
			$map['name'] = ['like', '%'.$keywords.'%'];
		}
		$data = $this->where($map)->order('id desc')->select();
		return $data;
	}
}